{include file="public/header2" /}
<div class="layui-form" lay-filter="layuiadmin-app-form-list" id="layuiadmin-app-form-list" style="padding: 20px 30px 0 0;">
  <div class="layui-form-item">
    <label class="layui-form-label">名称</label>
    <div class="layui-input-inline">
      <input type="text" lay-verify="required" name="name" value="{$item.name|default=''}" autocomplete="on" class="layui-input">
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">状态</label>
    <div class="layui-input-inline">
      <input type="checkbox" lay-skin="switch" lay-filter="switchStatus" lay-text="显示|隐藏" {notempty name="item.status"}{eq name="item.status" value="1"}checked{/eq}{else/}{eq name="data.status" value="-1"}{/eq}{/notempty} />
    </div>
  </div>
  <div class="layui-form-item layui-hide">
    <input type="text" id="status" name="status" value="{$item.status}" autocomplete="on" class="layui-input">
    <input type="hidden" name="id" id="id" value="{$item.id}" />
    <input type="button" lay-submit lay-filter="Lay-app-form-edit" id="Lay-app-form-edit" value="编辑">
  </div>
</div>
<script>
  layui.use(['layer','form'], function(){
    var $ = layui.$
            , form = layui.form;

    // 监听开关事件
    form.on('switch(switchStatus)', function(data){
      var x = data.elem.checked;
      if (x == true) {
        $("#status").val(1);
      } else {
        $("#status").val(-1);
      }
    });
  })
</script>
{include file="public/footer" /}